package com.controller.setting;

import com.comm.R;
import com.comm.vo.SystemRegisteredVo;
import io.swagger.annotations.*;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

@RequestMapping(value = "/systemRegistered")
@Controller
@Api(value = "挂号费test",tags = "挂号费接口API")
@ApiResponses({
        @ApiResponse(code=200,message="请求成功"),
        @ApiResponse(code=404,message="找不到页面"),
        @ApiResponse(code=403,message="请求禁止"),
        @ApiResponse(code=401,message="请求未授权"),
        @ApiResponse(code=500,message="后台服务错误")})

public class SystemRegistered {
    //1.1.1：条件查找挂号费
    @ResponseBody
    @RequestMapping(value ="/fundregistered",method = RequestMethod.GET)
    @ApiOperation(value = "条件查找挂号费接口",notes = "条件查找挂号费",httpMethod = "post", response = String.class)
    @ApiImplicitParam(name = "regtype",value = "你要查的",required = true,dataType = "String",paramType = "query")
    public  R fundregistered(@RequestParam(name = "regtype")String  regtype){
        R r = new R();
        r.setCode(200);
        r.setMsg("你好棒，查到了");
        String data = "{\n" +
                " \"data\": [{\n" +
                "   \"id\": 100001,\n" +
                "   \"regtype\": \"小姐姐\",\n" +
                "   \"regmoney\": 399,\n" +
                "   \"reg_items\": 2,\n" +
                "    \"childFee\":[{\n" +
                "\"cid\": 100001,\n" +
                "\"childId\":1,\n" +
                "\"childItemsname\":\"刮痧\",\n" +
                "\"childItemsmoney\":\"500\",\n" +
                "},{\n" +
                "\"cid\": 100001,\n" +
                "\"childId\":2,\n" +
                "\"childItemsname\":\"洗脚\",\n" +
                "\"childItemsmoney\":\"299\",\n" +
                "}\n" +
                "]\n" +
                "}\n" +
                "]}";
        r.setData(data);
        return r;
    }
//    1.1.2:查询所有的挂号费：
@ResponseBody
@RequestMapping(value ="/fundregistereds",method = RequestMethod.GET)
@ApiOperation(value = "查找挂号费接口",notes = "查找挂号费",httpMethod = "post", response = String.class)
public  R fundregistereds(){
    R r = new R();
    r.setCode(200);
    r.setMsg("你好棒，查到了");
    String data = "{\n" +
            " \"data\": [{\n" +
            "   \"id\": 100001,\n" +
            "   \"regtype\": \"小姐姐\",\n" +
            "   \"regmoney\": 399,\n" +
            "   \"reg_items\": 2,\n" +
            "    \"childFee\":[{\n" +
            "\"cid\": 100001,\n" +
            "\"childId\":1,\n" +
            "\"childItemsname\":\"刮痧\",\n" +
            "\"childItemsmoney\":\"500\",\n" +
            "},{\n" +
            "\"cid\": 100001,\n" +
            "\"childId\":2,\n" +
            "\"childItemsname\":\"洗脚\",\n" +
            "\"childItemsmoney\":\"299\",\n" +
            "}\n" +
            "]\n" +
            "},\n" +
            "{\n" +
            "   \"cid\": 100002,\n" +
            "   \"regtype\": \"小姐姐\",\n" +
            "   \"regmoney\": 399,\n" +
            "   \"reg_items\": 2,\n" +
            "    \"childFee\":[{\n" +
            "\"cid\": 100001,\n" +
            "\"childId\":1,\n" +
            "\"childItemsname\":\"刮痧\",\n" +
            "\"childItemsmoney\":\"500\",\n" +
            "},{\n" +
            "\"cid\": 100001,\n" +
            "\"childId\":2,\n" +
            "\"childItemsname\":\"洗脚\",\n" +
            "\"childItemsmoney\":\"299\",\n" +
            "}\n" +
            "]\n" +
            "}\n" +
            "]}";
    r.setData(data);
    return r;
}
    //1.1.3：添加挂号费的接口
    @ResponseBody
    @RequestMapping(value ="/addregistered",method = RequestMethod.POST)
    @ApiOperation(value = "添加挂号费接口",notes = "添加挂号费",httpMethod = "post", response = String.class)
    public  R addregistered(@RequestBody @ApiParam(value = "实体类",name = "Vo") SystemRegisteredVo Vo){
        R r = new R();
        r.setCode(200);
        r.setMsg("添加成功");
        return r;
    }
    //1.1.4：编辑挂号费的接口
    @ResponseBody
    @RequestMapping(value ="/editregistered",method = RequestMethod.POST)
    @ApiOperation(value = "编辑挂号费接口",notes = "编辑挂号费",httpMethod = "post", response = String.class)
    public  R editregistered(@RequestBody  @ApiParam(value = "实体类",name = "Vo")SystemRegisteredVo Vo){
        R r = new R();
        r.setCode(200);
        r.setMsg("编辑成功");
        return r;
    }
    //1.1.5：删除挂号费的接口
    @ResponseBody
    @RequestMapping(value ="/delregistered",method = RequestMethod.POST)
    @ApiImplicitParam(name = "regid",value = "你要删除的",required = true,dataType = "int",paramType = "query")
    @ApiOperation(value = "删除挂号费接口",notes = "删除挂号费",httpMethod = "post", response = String.class)
    public  R delregistered(@RequestParam("regid") Integer regid){
        R r = new R();
        r.setCode(200);
        r.setMsg("删除成功");
        return r;
    }
}
